<template>
    <router-view></router-view>
</template>

<script setup lang="ts">
import {onMounted, onUnmounted, provide, ref} from 'vue';
import {useDark} from '@vueuse/core'
import {checkVerticalScreen} from "./assets/ts/common-util";

// 黑暗模式
const isDark = useDark()
provide('isDark', isDark)

// 竖屏状态
const verticalScreen = ref(checkVerticalScreen())
provide('verticalScreen', verticalScreen)

// 生命周期
onMounted(() => {
    // 监听窗口变化
    window.onresize = () => {
        verticalScreen.value = checkVerticalScreen()
    }
    //
})
onUnmounted(() => {
    window.onresize = null
})

</script>


<style scoped>
</style>
